package com.example.mygrade.intercepter;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfigure implements WebMvcConfigurer {

    // 对所有的地址进行拦截除了以下地址
    @Override
    public void addInterceptors(InterceptorRegistry registry){
        registry.addInterceptor(new LoginIntercepter())
                .addPathPatterns("/**")
                .excludePathPatterns("/error","/login/student","/favicon.ico/**","/login/user","/student/verify","/webapi/verifycode/querycode",
                        "/js/**","/css/**","/plugins/**","/fonts/**","/api/login/**","/webapi/student/**","/webapi/login/**");
    }
}
